#include<map>
#include<set>
#include<cmath>
#include<vector>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#define rep(i,a,b) for(register int i = (a);i <= (b);++i)
#define per(i,a,b) for(register int i = (a);i >= (b);--i)  
typedef long long ll;
typedef unsigned long long ull;
using std::string;using std::cin;using std::cout;

const int Size = 100010;
int n,m,u,v,dfn[2*Size],low[2*Size],cnt,ans;
int ver[2*Size],next[2*Size],head[2*Size],tot;
bool iscut[Size];

inline void link(int x,int y){ver[++tot] = y , next[tot] = head[x] , head[x] = tot;}

inline void tarjan(int now,int father){
    dfn[now] = low[now] = ++cnt;
    int child = 0;
    for(int i = head[now];i;i = next[i]){
        if(!dfn[ver[i]]){
            tarjan(ver[i],father);
            low[now] = std::min(low[now],low[ver[i]]);
            if(low[ver[i]] >= dfn[now] && father != now) iscut[now] = true; 
            else if(father == now) ++child;
        }
        low[now] = std::min(low[now],dfn[ver[i]]);
    }
    if(child > 1 && father == now) iscut[now] = true;
    return;
}

int main(){
    std::ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    // freopen("in.in", "r", stdin);
    cin >> n >> m;
    rep(i,1,m){
        cin >> u >> v;
        link(u,v) , link(v,u);
    }
    rep(i,1,n) if(!dfn[i]) tarjan(i,i);
    rep(i,1,n) if(iscut[i]) ++ans;
    cout << ans << '\n';
    rep(i,1,n) if(iscut[i]) cout << i << ' ';
    return 0;
}